package com.santu.edu.supporter.biz.order.other.pojo.enums;

import com.santu.edu.supporter.exception.BizException;
import com.santu.edu.supporter.exception.CustomError;

/**
 * @author luoyaoqi
 * @createTime 2024/2/22
 * @description
 */
public enum OtherTypeEnum {

    /**
     *
     */
    HELPER_NOT_COMPLETED(0, "未完成"),
    HELPER_COMPLETED(1, "助人已完成"),
    CUSTOMER_CONFIRMED(2, "客户已确认");

    private Integer code;

    private String desc;


    OtherTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


    public static OtherTypeEnum convert(Integer code) {
        for (OtherTypeEnum otherType : OtherTypeEnum.values()) {
            if (otherType.getCode().equals(code)) {
                return otherType;
            }
        }
        throw BizException.causeBy(CustomError.ENUM_CONVERT_ERROR,"OtherTypeEnum转换异常");
    }
}
